#include <stdio.h>
int main (void)
{
	int n,i,a,b,c;
	scanf("%d",&n);
	int flag=0;
	for (a=0;a<n;a++)
	{
		for (b=0;b<n;b++)
		{
			for (c=0;c<(n/3);c++)
			{
				if (5*a+3*b+c==n&&a+b+c*3==n)
				{
					printf ("%d %d %d",a,b,c*3);
					printf ("\n");
					flag=1;
				}
			}
		}
	}
	if(flag==0)
	{
		printf ("NO\n");
	}
	return 0;
}
